/*
============================================================================
FileName	:	XQChatRosterNode.h
Author		:	liyake
Website		:	http://www.liyake.com
Create Data	:	2012-03-17 11:35
Change Data	:	2012-03-17 11:35 by liyake
Detail		:	The socket client of xqchat application
============================================================================
*/
#ifndef _XQCHAT_ROSTER_NODE_H_
#define _XQCHAT_ROSTER_NODE_H_

#include <QGraphicsObject>
#include "XQChatRoster.h"

namespace XQChat
{
	class CXQChatRosterNode : public QGraphicsObject
	{
		Q_OBJECT
	public:
		CXQChatRosterNode(CXQChatRoster* pRoster,QGraphicsItem * parent = 0);
		~CXQChatRosterNode(void);

	public:
		virtual void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
		virtual QRectF boundingRect() const;

	protected:
		void hoverEnterEvent( QGraphicsSceneHoverEvent* event );
		void hoverLeaveEvent( QGraphicsSceneHoverEvent* event );

	protected slots:
		void onHeaderIconChanged();

	private:
		CXQChatRoster* m_pRoster;
		QImage* m_pImage;
		bool m_bHovered;
	};
}

#endif //_XQCHAT_ROSTER_NODE_H_